from xgolib import XGO
import time


class XGOController:
    def __init__(self, xgo_device):
        self.xgo = XGO(xgo_device)

    def go(self, x="f"):
        if x == "f":
            self.xgo.move("x", 5)
        if x == "s":
            self.xgo.stop()
        if x == "b":
            self.xgo.move("x", -5)
            pass
        if x == "r":
            self.xgo.move("y",-5)
            pass
        if x == "l":
            self.xgo.move("y", 5)
            pass
        if x == "tr":
            self.xgo.turn(-15)
            pass
        if x == "tl":
            self.xgo.turn(15)
            pass
